﻿using Common.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wallpaper.Models.DTOs.Responses.Tag;

namespace Wallpaper.Models.DTOs.Responses.Wallpaper
{
    public class WallpaperPageResponse
    {
        /// <summary>
        /// 壁纸ID
        /// </summary>
        public string Id { get; set; }

        public string CategoryId { get; set; }

        /// <summary>
        /// 壁纸标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 原图URL（表格中可以直接显示图片）
        /// </summary>
        public string FileUrl { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        public string CategoryName { get; set; }

        /// <summary>
        /// 上传人名称
        /// </summary>
        public string UploaderName { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }

        /// <summary>
        /// 上传人类型
        /// </summary>
        public UploaderType UploaderType { get; set; }

        // 显示文本（后端处理）
        public string UploaderTypeText => UploaderType switch
        {
            UploaderType.NormalUser => "小程序用户",
            UploaderType.Admin => "后台人员",
            UploaderType.System => "系统",
            _ => "未知"
        };
        /// <summary>
        /// 审核状态
        /// </summary>
        public WallpaperReviewStatus ReviewStatus { get; set; }

        /// <summary>
        /// 审核状态文本
        /// </summary>
        public string ReviewStatusText => ReviewStatus switch
        {
            WallpaperReviewStatus.Pending => "待审核",
            WallpaperReviewStatus.Approved => "通过",
            WallpaperReviewStatus.Rejected => "不通过",
            _ => "未知"
        };

        public List<TagResponse> Tags { get; set; } = new List<TagResponse>();

        /// <summary>
        /// 审核人
        /// </summary>
        public string ReviewerName { get; set; }

        /// <summary>
        /// 审核意见
        /// </summary>
        public string ReviewComment { get; set; }

        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? ReviewedTime { get; set; }
    }
}
